﻿using System;
using System.Xml.Serialization;
using System.Diagnostics;

namespace CCAI.Office.PowerPoint.AddIn.Core
{
    public class DataContractString : IXmlSerializable
    {
        public System.Xml.Schema.XmlSchema GetSchema()
        {
            return null;
        }
        public void ReadXml(System.Xml.XmlReader reader)
        {
            reader.MoveToContent();
            Value = reader.ReadString();
        }
        public void WriteXml(System.Xml.XmlWriter writer)
        {
            writer.WriteCData(Value);
        }

        public string Value
        {
            get;
            set;
        }
        public static implicit operator DataContractString(string str)
        {
            return new DataContractString() { Value = str };
        }
        public static implicit operator String(DataContractString value)
        {
            return value.Value;
        }
    }
}
